import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import config from '../webpack.config';
// console.log('server client:'+process.env.NODE_ENV)
new WebpackDevServer(webpack(config), {
    publicPath: config.output.publicPath,
    hot: true,
    historyApiFallback: true,
    // It suppress error shown in console, so it has to be set to false.
    quiet: false,
    // It suppress everything except error, so it has to be set to false as well
    // to see success build.
    noInfo: false,
    stats: {
        // Config for minimal console.log mess.
        assets: false,
        colors: true,
        version: false,
        hash: false,
        timings: false,
        chunks: false,
        chunkModules: false
    },
    proxy: {
        '/list': {
            target: 'http://lol.qq.com/web201310/js/videodata/LOL_VIDEOLIST_IDX3.js',
            pathRewrite: { '^/list': '' },
            changeOrigin: true,
            secure: false
        },
        '/api':{
            //target:'http://192.168.1.132:16000/',
            target:'https://test.51anxintou.com/',
            //target:'https://www.51anxintou.com/',
            changeOrigin:true,
            // pathRewrite:{
            //     '^/api':''
            // },
          },
          '/info':{
            target:'https://data.51anxintou.com/',
            changeOrigin:true,
            // pathRewrite:{
            //     '^/api':''
            // },
          },
          '/anxintou':{
            target:'https://data.51anxintou.com/',
            changeOrigin:true,
            // pathRewrite:{
            //     '^/api':''
            // },
          },
          
    }
}).listen(3334, 'localhost', function (err) {
    if (err) {
       // console.log(err);
    }
    //console.log('Listening at localhost:3333');
});